All Functions Used on PO11Q

complete.cases

{stats}

Find Complete Cases

t.test

{stats}

Performs one and two sample t-tests on vectors of data.

ggplot

{GGPLOT2}

Create a ggplot graph

sample_n

{dplyr}

Sample a number of observations from a data frame

separate

{dplyr}

Separate a character column into multiple columns

mean

{base}

Get mean of a vector

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

head

{utils}

Show first 5 rows of a data frame

factor

{base}

Create a factor

geom_bar

{GGPLOT2}

Generates a bar chart

mutate

{dplyr}

Modify/create a column in a data frame

slice

{dplyr}

Subset rows using their positions

stat_ecdf

{GGPLOT2}

Compute empirical cumulative distribution

theme

{GGPLOT2}

Set theme for GGPLOT2

recode

{dplyr}

Recode a variable

write.csv

{utils}

write a csv file to a data frame

ylab

{GGPLOT2}

Label the y axis (ggplot)

n

{dplyr}

The number of observations in the current group.

library

{base}

Load an R package

seq

{base}

Create a sequence

max

{base}

Get maximum of a vector

spread

{tidyr}

Spread a key-value pair across multiple columns

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

arrange

{dplyr}

Sort values of data frame according to a variable/combination of varaibles

prop.test

{stats}

Test of Equal or Given Proportions

c

{base}

Combine values/vectors into a vector

names

{base}

Retrieve names of a list/vector

read_excel

{readxl}

Read an Excel file

summary

{base}

Obtain summary statistics or detailed regression output

aes

{GGPLOT2}

Construct aesthetic mapping of a ggplot graph

element_text

{GGPLOT2}

Customise text in GGPLOT2

boxplot

{graphics}

Plot a simple box plot

median

{stats}

Get median of a vector

data.frame

{base}

Create a data.frame from vectors

geom_histogram

{GGPLOT2}

Generates a histogram

range

{base}

Return range of values

str

{utils}

Get the structure of an R object

labs

{GGPLOT2}

Customise labels in GGPLOT2

is.na

{base}

Check if a value is NA/elements of vector are NA

set.seed

{base}

Initialise a pseudorandom number generator.

ungroup

{dplyr}

Resolve grouping created with “group_by”

ordered

{dplyr}

Create an ordered factor

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

setwd

{base}

Set Working Directory

read_dta

{haven}

Read a .dta file (Stata data)

min

{base}

Get minimum of a vector

ecdf

{stats}

Compute an empirical cumulative distribution function

var

{stats}

Calculate variance

levels

{base}

Get levels of a factor

sum

{base}

Get sum of numeric values or a vector

as.numeric

{base}

Coerce a vector to numeric

with

{base}

evaluate expression in the context of a data frame

scale_y_continuous

{GGPLOT2}

Customise continuous y axis

save

{base}

Writes an external representation of R objects to the specified file.

summarize

NA

hist

{graphics}

Plot a simple histogram

select

{dplyr}

Select columns from a tibble/data frame

as.character

{base}

Coerce a vector to character

theme_classic

{GGPLOT2}

A minimalistic theme with no gridlines

scale_x_continuous

{GGPLOT2}

Customise continuous x axis

filter

{dplyr}

Filter out rows of a data frame according to logical vector

summarise

{dplyr}

collapse the dataset to a summary statistic. Usually used with group_by()

geom_segment

{GGPLOT2}

Generates a line segment or curve

sqrt

{stats}

Square root

sd

{stats}

Get standard deviation of a vector

cut

{base}

Convert Numeric to Factor

ifelse

{base}

Return a or b depending on the value of test

write_dta

NA

desc

{dplyr}

Arrange in descending order

The end!